<template>
  <div class="home-recommend">
    <h1 class="title">热销推荐</h1>
    <ul class="list">
      <router-link tag="li" :to="`/detail/${recommend.id}`" class="item border-bottom" v-for="recommend in list" :key="recommend.id">
        <div class="img">
          <img :src="recommend.imgUrl">
        </div>
        <div class="info">
          <h2 class="item-title">{{ recommend.title }}</h2>
          <p class="item-desc">{{ recommend.desc }}</p>
          <button>查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'home-recommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.home-recommend
  .title
    line-height .8rem
    background #eee
    text-indent .2rem
  .list
    .item
      height 1.9rem
      display flex
      overflow hidden
      .img
        width 1.7rem
        height 1.7rem
        padding .1rem
        img 
          display block
          width 100%
      .info
        flex 1
        padding .1rem
        width 0
        .item-title
          line-height .54rem
          font-size .32rem
          elipsis()
        .item-desc
          line-height .4rem
          color #ccc
          elipsis()
        button 
          line-height .44rem
          margin-top .16rem
          background #ff9300
          padding 0 .1rem
          border-radius .06rem
          color #fff
</style>